<?php


namespace App\Http\Controllers\Customer\Common;


use App\Http\Controllers\Controller;
use App\Http\Requests\Customer\Common\Download\HsCodeRequest;
use App\Repositories\HsCode;

class DownloadController extends Controller
{
    /**
     * @param HsCodeRequest $request
     * @param HsCode $code
     * @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\BinaryFileResponse
     * @author luffyzhao@vip.126.com
     */
    public function hsCode(HsCodeRequest $request, HsCode $code)
    {
        return $code->template(
            $request->input('code')
        )->download(sprintf("海关编码[%s]申报要素.xlsx", $request->input('code')));
    }
}
